/**
 * Created with JetBrains WebStorm.
 * User: MASTER
 * Date: 25/11/12
 * Time: 19:25
 * To change this template use File | Settings | File Templates.
 */
var boletaInfraClass22 = {
    layout: null,
    formPanel: null,
    str: null,
    widgetTab: function(){
        var disTab,
            me = this;
        mainTab.addTab("bolInfraTab", "Diseñador de Boletas", "150px", "-1");
        disTab = mainTab.cells('bolInfraTab');
        me.layout = disTab.attachLayout('1C');
        mainTab.setTabActive("bolInfraTab");
    },
    widgetForm: function(){
        var me = this;
        me.formPanel = me.layout.cells('a');
        me.formPanel.setText("Transcripción de Boleta de Infraestructura y Servicios Municipales");
    },
    setPropertysItemsForm: function(codeModulo){
        var me = this;
        for(var i in me.str){
            switch(me.str[i].type){
                case 'calendar':
                    me.str[i].offsetLeft = 18;
                break;
                case 'input':
                    me.str[i].offsetLeft = 18;
                break;
                case 'button':
                    me.str[i].offsetLeft = 15;
                    me.str[i].offsetTop = 28;
                break;
                case 'container':
                    me.str[i].offsetLeft = 18;
                break;
                default:
                    me.str[i].offsetLeft = 15;
                break;
            }
            switch(me.str[i].validate){
                case 'NotEmpty':
                    me.str[i].tooltip = "El dato de este campo es requerido.";
                break;
                case 'ValidInteger':
                    me.str[i].tooltip = "Este campo solo acepta numero enteros.";
                break;
            }
            me.str[i].modulo = codeModulo;
        }
    },
    prueba: function(){
        var me = this;
        me.str = [
            { type: "container", name: "myGrid1", position:"label-top", label: "2.2	¿Cuál es la formación educativa de los funcionarios que trabajaron en el Gobierno Municipal en la gestión 2011?", inputWidth: 330, inputHeight: 385  },
        ];
        me.setPropertysItemsForm();
        var form = me.formPanel.attachForm(me.str);

        var grid = new dhtmlXGridObject(form.getContainer("myGrid1"));
        grid.setHeader("#, Detalle, Bachiller, Técnico, Universitario, Profesional, Otros, Total");
        grid.setInitWidths("30,*,*,*,*,*,*,*");
        grid.setColAlign("right,left,left,left,left,left,left,left");
        grid.setColSorting("str,str,str,str,str,str,str,str");
        grid.init();
        grid.loadXML(mainPath+"xml/gridsGes/gridEcPPre5.xml");
    },
    widgetMain: function(){
        var me = boletaInfraClass;

        dhxLayout.cells("b").collapse();

        me.widgetTab();
        me.widgetForm();

        me.prueba();
    }
};